//index.js
//获取应用实例
var app = getApp();

Page({
  data: {
    motto: '',
    userInfo: {}
  },
  //事件处理函数
  start: function () {
    var data = wx.getStorageSync('bookmark') || {
      book: 'old',
      chapter: 0,
      section: 0
    };

    var scroll = wx.getStorageSync('content-scroll') || 0;

    wx.redirectTo({
      url: '../content/content?book=' + data.book + '&chapter=' + data.chapter + '&section=' + data.section + '&scroll=' + scroll
    });
  },
  onLoad: function () {
    var that = this
    //调用应用实例的方法获取全局数据
    app.getUserInfo(function (userInfo) {
      //更新数据
      that.setData({
        userInfo: userInfo
      });
    });

    // wx.redirectTo({
    //   url: '../content/content'
    // });

    // wx.redirectTo({
    //   url: '../catalog/catalog?book=old&chapter=1&section=1'
    // });

    // wx.navigateTo({
    //   url: '../about/about'
    // });

  }
})
